home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-12-12 | 49.7 KB | 1,214 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CHOICE
- Version 1.1
- REFERENCE AND INSTALLATION MANUAL
-
-
- Copyright 1987
- R. S. MacDonald
- All rights reserved
-
-
- CHOICE V1.1 COPYRIGHT 1987 R. S. MacDonald
-
- CONTENTS
-
-
- INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . 1
- CONFIGURATION MODE . . . . . . . . . . . . . . . . . . . 1
- MENU MODE . . . . . . . . . . . . . . . . . . . . . . . . 1
-
- SYSTEM REQUIREMENTS . . . . . . . . . . . . . . . . . . . . . 2
-
- INSTALLATION . . . . . . . . . . . . . . . . . . . . . . . . . 2
- INSTALLC.BAT . . . . . . . . . . . . . . . . . . . . . . 2
- INSTALLING FOR MENU USE . . . . . . . . . . . . . . . . . 2
- INSTALLING FOR CONFIGURATION USE . . . . . . . . . . . . 3
- INSTALLING WITH INSTALLC.BAT . . . . . . . . . . . . 3
- AUTOEXEC.BAT . . . . . . . . . . . . . . . . . . . . 4
-
- FILE FORMATS . . . . . . . . . . . . . . . . . . . . . . . . . 5
- PROFILE FILES . . . . . . . . . . . . . . . . . . . . . . 5
- MENU FILES . . . . . . . . . . . . . . . . . . . . . . . 6
-
- PARAMETERS AND OPTIONS . . . . . . . . . . . . . . . . . . . . 7
- EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . 8
-
- SCENARIOS . . . . . . . . . . . . . . . . . . . . . . . . . . 8
- CONFIGURATION MODE . . . . . . . . . . . . . . . . . . . 8
- SECURITY OPTION . . . . . . . . . . . . . . . . . . 8
- EXAMPLES . . . . . . . . . . . . . . . . . . . . . . 9
- EXAMPLE 1 . . . . . . . . . . . . . . . . . . . 9
- EXAMPLE 2: . . . . . . . . . . . . . . . . . . 10
- PRECAUTIONS . . . . . . . . . . . . . . . . . . . . 10
- MENU MODE . . . . . . . . . . . . . . . . . . . . . . . . 11
- EXAMPLE . . . . . . . . . . . . . . . . . . . . . . 11
- EXAMPLE 1 . . . . . . . . . . . . . . . . . . . 11
- EXAMPLE 2 . . . . . . . . . . . . . . . . . . . 12
- EXAMPLE 3 . . . . . . . . . . . . . . . . . . . 12
-
- ERROR MESSAGES . . . . . . . . . . . . . . . . . . . . . . . . 13
-
- MISCELLANEOUS . . . . . . . . . . . . . . . . . . . . . . . . 16
-
- WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
-
- LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
-
- CHOICE PLUS . . . . . . . . . . . . . . . . . . . . . . . . . 17
- OBTAINING CHOICE+ . . . . . . . . . . . . . . . . . . . . 17
-
- CHOICE+ ORDER FORM . . . . . . . . . . . . . . . . . . . . . . 18
-
-
-
-
-
-
-
-
-
- CHOICE Page i
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- INTRODUCTION
-
- CHOICE is a simple, multi-purpose menu program. It can be used to
- choose between several applications using only the cursor movement
- and enter keys. It can also be called from your AUTOEXEC.BAT file
- where it allows you to choose between different configurations.
- After you choose a configuration, CHOICE will replace your
- CONFIG.SYS with the one you chose, create an AUTO1.BAT file, and
- re-boot the system. CHOICE is distributed as a public domain
- program for personal use only. Please contact the author if you
- want to use CHOICE for commercial purposes. Donations for using
- CHOICE are not required, but will not be refused.
-
- An enhanced version of CHOICE, CHOICE+ is also available for a
- small license fee. It includes the ability to substitute variable
- parameters when calling programs or batch files from menus, an
- editor for building menus and profiles, and several other added
- features. In this document, those functions included only in
- CHOICE+ are indicated for information purposes. The actual
- implementation in CHOICE+ may differ slightly from the descrip-
- tions here.
-
- Version 1.1 of CHOICE fixes a problem with an error message if the
- /B option is specified, makes CHOICE ignore menu file records that
- are defined only for CHOICE+ files, and enhances this document
- slightly.
-
-
- CONFIGURATION MODE
-
- When CHOICE is executed by your AUTOEXEC.BAT file in configuration
- mode it will display a menu of choices. You select one by moving
- the cursor to the desired item and pressing enter.
-
- After that, CHOICE copies the files associated with that menu item
- to files named AUTO1.BAT and CONFIG.SYS. It then re-boots the
- machine so that the chosen CONFIG.SYS will be used.
-
- When CHOICE is called on the second boot it knows that it caused
- the boot and returns immediately to the AUTOEXEC.BAT that called
- it. The last statement in AUTOEXEC.BAT should call AUTO1.BAT
- which continues the setup for the configuration that you chose.
-
-
- MENU MODE
-
- When CHOICE is run as a menu program, it displays a menu with up
- to 32 choices. You can select one with the cursor keys. When the
- cursor is on your choice, you press enter and choice will run that
- selection. CHOICE will execute that program or batch file as a
- sub-program to CHOICE. When the sub-program completes, CHOICE
- will re-display the menu. The escape key can be used to exit the
- menu.
-
-
-
- CHOICE Page 1
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- SYSTEM REQUIREMENTS
-
- The CHOICE.EXE file is about 30K bytes long and requires about 96K
- with DOS 3.2 (plus the size of any programs executed in menu mode)
- to operate. You must have DOS 2.0 or later (tested on 2.1 and
- 3.2). At least 256K of RAM is recommended for menu use.
-
- INSTALLATION
-
- The following files are included in CHOICE11.ARC:
-
- 1. README.1ST 2. CHOICE.DOC
- 3. INSTALLC.BAT 4. CHOICE.EXE
- 5. CHOICEDOC.MNU 6. CHOICE.PRO
- 7. $CONFIG.XXX 8. $CONFIG.YYY
- 9. VANILLA.AUT 10. AUTOCHC1.BAT
- 11. AUTOCHC2.BAT 12. CHOICMNU.BAT
-
-
- The easiest way to install CHOICE is to extract INSTALLC.BAT
- first:
-
- ARC x CHOICE installc.bat
- ARCE CHOICE installc.bat
- PKXARC -X CHOICE installc.bat
-
- Then execute INSTALLC. For speed, you can move CHOICE11.ARC to a
- RAM disk before extracting files.
-
-
- INSTALLC.BAT
-
- Just enter INSTALLC and CHOICE will give you a menu. The menu
- items allow you to:
-
- 1. Extract the files from CHOICE11.ARC
- 2. Display the README.1ST file.
- 3. Display, print, or type the documentation file.
- 4. Install CHOICE.EXE on disk A, B, C, or D.
- 5. Install the examples on any of the above disks.
-
-
- INSTALLING FOR MENU USE
-
- If you are planning to use CHOICE only to provide the menu
- function, you need only to copy CHOICE.EXE to the diskette(s) on
- which you will use it or to a convenient directory on your hard
- disk. The INSTALLC Install Choice item will put CHOICE.EXE in the
- root directory. To use CHOICE you will have to build one or more
- menu files. Menu Files are described in a separate section below.
- See also the examples section for ways to run it. Sample menu
- files are included in the ARC file.
-
-
-
-
- CHOICE Page 2
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- INSTALLING FOR CONFIGURATION USE
-
- This process is not terribly difficult but requires more than
- merely copying files. You must build a CHOICE.PRO file (you can
- use the supplied example as a starter), build one or more
- CONFIG.SYS files (naming them something else), then modify
- AUTOEXEC.BAT to call CHOICE and to call AUTO1.BAT as its last
- step.
-
-
- INSTALLING WITH INSTALLC.BAT
-
- INSTALLC will, when you select the proper items, copy CHOICE.EXE
- to the root directory of your boot disk and install the configura-
- tion mode sample files in the root directory of a disk. The
- procedure that it uses to install the sample files is:
-
- a. If the file SAVECFG.SYS does not exist, rename CONFIG.SYS
- to that name. Otherwise, display an error message and
- skip this step.
- b. If the file SAVEAUTO.BAT does not exist, rename
- AUTOEXEC.BAT to that name and copy AUTOCHC1.BAT to that
- name. Otherwise display an error message and skip this
- step.
- c. Copy the files CHOICE.PRO, $CONFIG.XXX, $CONFIG.YYY and
- AUTOCHC2.BAT to the boot disk root directory.
-
- If you do not use INSTALLC, you should do the same things but you
- can use different names for the saved copies of CONFIG.SYS and
- AUTOEXEC.BAT. Do not skip that step or you may not be able to
- restore your original setup.
-
- After the sample files are installed, you may need to do a few
- more things to make the examples work or to define configurations
- for your daily use. These are:
-
- a. Edit the CHOICE.PRO file with your favorite editor and
- modify it according to the directions in the "PROFILE"
- section below. This is not required just to use the
- examples.
- b. Use your editor to modify the first statement in the
- sample AUTOEXEC.BAT file with valid path names for your
- disk setup or modify your original AUTOEXEC.BAT file to
- call CHOICE. See the example in the AUTOEXEC section
- below.
- c. Again with your favorite editor, build batch files that
- can be used as extensions to your AUTOEXEC.BAT file for
- each of your configurations. This is not required just to
- use the examples.
-
- Once you have done the above, you are ready to use CHOICE. You
- will probably want to define additional configurations. You can
- do that at any time. Just use your editor to build the required
- configuration and autoexec extension files and modify the profile
- so that they will be used.
-
- CHOICE Page 3
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- AUTOEXEC.BAT
-
- Your new AUTOEXEC.BAT file will probably be shorter than the one
- you are using now. You should keep in it only those things that
- you want to do for ALL configurations. The things that differ
- between configurations will be in your extension batch files. In
- the description below, refer to the files AUTOCHC1.BAT and
- AUTOCHC2.BAT supplied in the package. They are sample
- AUTOEXEC.BAT files.
-
- CHOICE.EXE should be called either by the first statement of your
- AUTOEXEC.BAT or right after a PATH statement that allows DOS to
- find it. In the example below, CHOICE.EXE is assumed to be in one
- of the sub-directories referenced by the PATH statement. Note
- that the numbers to the left of the statements are not actually in
- the .BAT file but are referenced in the description that follows.
-
- 1 PATH c:\;c:\util;c:\dos
- 2 CHOICE /P /B
- 3 auto1
-
- Statement 1 defines a path that can be used to find the programs
- called by both AUTOEXEC.BAT and AUTO1.BAT. In statement 2, CHOICE
- is executed with the /B option, which tells it to re-boot the
- system after it gets the configuration name from you. On the next
- pass, after the re-boot, CHOICE will detect that the system has
- been re-booted and will not do so again. In that case, the
- AUTO1.BAT file will be executed. For further examples, see the
- examples in the SCENARIOS section.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CHOICE Page 4
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- FILE FORMATS
-
- PROFILE FILES
-
- The CHOICE.PRO, the configuration files and batch files must all
- be in your default directory at the time that CHOICE is executed
- (sorry about that). CHOICE.EXE can be in another directory if a
- proper path has been defined.
-
- The file CHOICE.PRO describes the configurations that you wish to
- be able to select at boot time. Each record in the file contains
- an application name (up to 8 characters), the name of the autoexec
- extension batch file (which can include a path but is limited to a
- total of 64 characters), and the name of the configuration file
- (up to 16 characters) that will be copied into a temporary
- CONFIG.SYS file. Following those fields, you may add a help text
- field if you wish. The help text will be displayed by CHOICE if
- the cursor is positioned to an application name and F1 is pressed.
- Each of these fields is separated from the next by an exclamation
- mark and one or more blanks. The following is a sample profile:
-
- chocolat! auto1.cho! config.yum! Basic DOS with 320K VDISK!
- accounts! auto1.bus! config.foo! Direct to Accounting!
- vanilla! auto1.van! config.yum! Basic DOS - No VDISK!
- progdev! AUTO1.BZZ! cfg.pgd! Program Development!
-
- While a profile file is required to run CHOICE, it only needs to
- contain one record. Of course if it has only one record, then you
- don't need CHOICE. The format of a profile record is:
-
- Appplication Name: This is displayed to the user in the menu.
- It has a maximum length of 8 characters.
- Batch Name: the path and name of a batch file that will be
- invoked after the autoexec.bat as AUTO1.BAT. It has a
- maximum length of 64 characters.
- Config Name: the name of a configuration file that will
- become config.sys for the re-boot. It has a maximum
- length of 16 characters.
- Help Text: a description of the application that will be
- displayed if the user presses F1 when the application name
- is highlighted in the menu. It has a maximum length of 64
- characters.
-
- Notes:
- 1. Each field is terminated with an exclamation point. At
- least one blank must appear before the next field. The
- maximum field lengths do not include the exclamation marks
- or any leading blanks.
- 2. The maximum record length is 255 bytes including any extra
- blanks between fields.
-
-
-
-
-
-
- CHOICE Page 5
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- MENU FILES
-
- Menu files are similar to profile files in concept but have a
- slightly different form. A menu can contain up to 32 menu records
- (no more than 28 are recommended). Each record has three fields:
-
- Application Name: This field, up to 32 characters long, is
- displayed on the menu. It starts in column 1 (or 2 if the
- menu is within a .BAT file) and ends with an exclamalation
- point.
-
- Command: A batch or executable file name and any necessary
- parameters and options with a maximum length of 64
- characters. CHOICE will directly execute the command.
- This field must also be ended with an exclamation point.
-
- Help text: A description of the application up to 64 charac-
- ters long. This is used to provide a help display if the
- user presses F1 when the menu item is highlighted. It may
- also be terminated by an exclamation point.
-
- Fields are separated by an exclamation blank and one or more
- blanks. The maximum record length is 255 bytes.
-
- RESTRICTIONS:
-
- CHOICE will ignore the following records defined for special
- purposes by CHOICE+. Note that case is ignored in all of these.
-
- - a SET record that assigns values to variables that may be
- either constant values or descriptions used to ask the
- user for input. A set record starts with the word 'SET'
- which is a reserved word as the first word in the applica-
- tion name field (:set in batch files).
- - a COMMENT record for documentation only. It starts with an
- asterisk (*). An asterisk is not allowed as the first
- character of the application name field.
- - a MENU LABEL record that allows multiple menus in one file.
- This record starts with a $ in column 1 (or 2 if batch
- file). A dollar sign is also not allowed in the first
- column of the application name field (:$ in a batch file).
- - an END record to indicate the end of a menu. It has the
- form $END (:$END in a batch file).
-
- The menu file can be contained in a batch file (including the one
- that calls CHOICE). When a menu file extension is .BAT, CHOICE
- scans for the first label record in the file (a record starting
- with a colon) and uses all label records from that point to the
- first non-label record as menu records. It saves considerable
- disk space on a hard disk to include the menu in the batch file
- that calls CHOICE.
-
-
-
-
-
- CHOICE Page 6
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- PARAMETERS AND OPTIONS
-
- CHOICE can be invoked with parameters to provide a file name for
- the profile or the menu file. The command line can also contain
- some option fields that make it work different ways. The first
- character of an option may be either a slash (/) or a dash (-).
- They are shown with a slash in this documentation. Options can
- appear anywhere in the command line.
-
- The command syntax is:
-
- CHOICE /M filename [/W]
-
- or
-
- CHOICE /P [profile] [/B[1]] [/S] [/T[n]] [/W]
-
- In the above syntax diagram the symbols '[' and ']' mean that
- whatever inside them is optional. The symbols '<' and '>' mean
- that you can choose between the item groups (separated by a
- vertical bar '|') included within them but ONE must be included.
-
- /M selects the menu mode. It causes CHOICE to use a menu
- file rather than a profile file (they are basically
- similar) and suppresses the boot, secure, and timing
- options.
- filename is the path, filename, and extension of a menu
- definition file.
-
- /P selects the profile mode. It causes choice to use a
- profile file and allows the boot secure and timing options
- to be used.
- profile is the path, file name, and extension of either a
- profile file. Although it is always referred to in this
- document as CHOICE.PRO, that name is not required.
- /B tells CHOICE that it should re-boot the machine when it
- finishes rather than returning to the autoexec.bat file.
- It will work on a normal IBM PC and on some clones.
- /B1 causes CHOICE to do a forced boot of the system. It is
- not used for normal operations. It will ALWAYS cause a
- re-boot.
- /S initiates secure mode. When specified, the user cannot
- get a list of the profile and cannot use escape to break
- exit CHOICE. It offers a minimum amount of security for
- those who need it. See the section on security mode for
- further explanation.
- /T[n] causes CHOICE to start a timeout. If you do not start
- to type an application code within n seconds, the applica-
- tion represented by the first profile record will be
- selected. The number of seconds may be any value from 1
- to 99999. If the /S option is also present, this option
- will be ignored. If the n value is omitted, a default of
- 30 seconds will be used.
-
-
-
- CHOICE Page 7
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- /W causes CHOICE to use the BIOS for video writes instead or
- writing directly to the screen. While this is slower, it
- makes CHOICE a "well-behaved" program as defined by
- Windows, Topview, and DESQ. You should use it if you are
- running under any of the above, although DESQ will allow
- it to run without the /W option if you tell DESQ that it
- writes directly to the screen. /W is the default when a
- 40 column monitor is in use.
-
-
- EXAMPLES
-
- Just to help you see what the command could look like, here are
- two examples that include all possible parameters and options:
-
- CHOICE /M choicdoc.mnu -w
- CHOICE -p choice2.pro -B /W -t30
-
- Note that options and parameters may be in any case and that an
- option can start with either a slash or a dash.
-
-
-
- SCENARIOS
-
- CONFIGURATION MODE (/P)
-
- In configuration mode if /S was not specified CHOICE lists the
- application names in a window on the screen along with a prompt to
- select an application code and press enter. You can move the
- cursor around among the names using the up and down arrow, Home,
- and End keys. As the cursor is moved around, the selected
- application name will be highlighted. Once the right name is
- highlighted, pressing Enter will select that configuration. After
- pressing Enter, CHOICE will copy the batch and sys files that go
- with that record to AUTO1.BAT and CONFIG.SYS. If an error occurs
- (such as a non-existing file), an error message will be issued and
- after you press a key, CHOICE will continue as if no error had
- occurred. Because the error occurred the re-boot will either find
- no CONFIG.SYS or no AUTO1.BAT file.
-
- If you use the /B option, CHOICE will re-boot the system on POR
- and every other time it is called after that (as long as it's flag
- in the DOS user communications area is not changed by another
- program). If that flag does not exist, it will boot the system
- when it is run.
-
- If you use the /B1 option, CHOICE will re-boot the system every
- time it is run.
-
-
- SECURITY OPTION
-
- The security option offers a minimum amount of security to the
- user of CHOICE in configuration mode. When the /S option is
-
- CHOICE Page 8
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- included in the command line, CHOICE will not display the choices
- in the configuration menu, nor will the cursor movement or help
- (F1) keys work. The user must type one of the application names
- in the first field of the profile record (or press Control-Break)
- to exit. If a non-existent name is typed, CHOICE will display an
- error message in the menu and ask the user to enter an application
- name again. Since the names are not displayed and the user has no
- easy way to show them while CHOICE is executing, the user will be
- at a loss to determine what to type. The application name must be
- entered exactly as it appears in the profile including the case.
- CHOICE+ will disable the Control-Break key as well.
-
-
- EXAMPLES
-
- There is a chance of causing problems if the sample files are
- installed and you run CHOICE in configuration mode before getting
- it fully set up. DO NOT RUN CHOICE IN CONFIGURATION MODE until
- you have saved your CONFIG.SYS and AUTOEXEC.BAT files under other
- names and you are sure that you know what will happen when CHOICE
- is run. The AUTOEXEC.BAT files are included in the archive file
- under the names AUTOCHC1.BAT and AUTOCHC2.BAT to prevent acciden-
- tal replacement of your current file.
-
-
- EXAMPLE 1:
-
- Assume that the files VANILLA.AUT, $CONFIG.XXX and $CONFIG.YYY
- exist in the root directory and that CHOICE.PRO contains the
- following:
-
- vanilla! vanilla.aut! CONFIG.XXX! Basic Setup.!
- choc! vanilla.aut! config.yyy! Same as vanilla but with VDISK.!
-
- Assume that AUTOEXEC.BAT (from AUTOCHC1.BAT) contains:
-
- echo off
- PATH c:\;c:\bat;c:\util;c:\dos
- CHOICE /P /B /T30
- AUTO1
-
- When CHOICE is executed by AUTOEXEC.BAT and you press enter at
- either of the menu items, it will create (or replace) the file
- AUTO1.BAT by copying VANILLA.AUT, copy either $CONFIG.XXX or
- $CONFIG.YYY to CONFIG.SYS and re-boot the system. On the boot,
- the new CONFIG.SYS will be used and CHOICE will be executed again.
- It will see that it re-booted the system and exit without display-
- ing a menu. The last step of AUTOEXEC.BAT will call AUTO1.BAT
- which will do its thing and everything will be cool (we hope).
-
-
-
-
-
-
-
- CHOICE Page 9
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- EXAMPLE 2:
-
- Assume that the files VANILLA.AUT, CONFIG.XXX and CONFIG.YYY exist
- in the root directory and that CHOICE.PRO contains the following:
-
- vanilla! vanilla.aut! CONFIG.XXX! Basic Setup.!
- choc! vanilla.aut! config.yyy! Same as vanilla with VDISK!
-
- Assume that AUTOEXEC.BAT (from AUTOCHC2.BAT) contains:
-
- echo off
- PATH c:\;c:\bat;c:\util;c:\dos
- if exist CONFIG.SYS goto nochc
- CHOICE /P /T30 /B1
- :nochc
- erase config.sys
- AUTO1
-
- When CHOICE is executed by AUTOEXEC.BAT, it will create the file
- AUTO1.BAT by copying VANILLA.AUT, copy either $CONFIG.XXX or
- $CONFIG.YYY to CONFIG.SYS and will re-boot the system because of
- the /B1 option. On the boot, CONFIG.SYS will be used and CHOICE
- will not be executed again because of the if exist statement. The
- next line will erase config.sys to prepare for the next boot and
- the last step of AUTOEXEC.BAT will call AUTO1.BAT which will do
- its thing and everything will be cool again.
-
-
- PRECAUTIONS
-
- Be sure to back up your AUTOEXEC.BAT and CONFIG.SYS files before
- you start installation. If you run this program in configuration
- mode with the sample files installed, THE CONFIG.SYS FILE WILL BE
- REPLACED BY $CONFIG.XXX OR $CONFIG.YYY. If you have a file called
- AUTO1.BAT you must rename it before attempting an boot with this
- program since it will be replaced by the bat file named in the
- profile.
-
- If you use the /B option you must be sure not to install any
- resident DOS extensions prior to the call to CHOICE. If you do
- that and one of those extensions has trapped any interrupt vectors
- then the vectors will point to non-existing code points until the
- traps have been set up again. That could cause things to bomb,
- possibly intermittently.
-
-
-
-
-
-
-
-
-
-
-
-
- CHOICE Page 10
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- MENU MODE (/M)
-
- In menu mode, CHOICE is executed with the /M option and one
- parameter: the menu file name. Any other options are ignored.
- CHOICE will read the menu file records and build a menu of up to
- 12 lines on the display screen from the first field of each
- record. Each line will have either one or two menu options
- depending on the width of your display (if you are running in 40
- column mode, the menu will be 40 columns wide with one column and
- a maximum of 16 choices. Otherwise it will be 80 columns wide with
- two columns and up to 32 choices).
-
- Selection from the menu is done in the same way as in configura-
- tion mode. You move the cursor to the desired entry with the up,
- down, home, and end keys and press the enter key. The command in
- the second field of the corresponding menu record will be executed
- as a sub-program of CHOICE.
-
- Just as in configuration mode, a help window will be displayed if
- you press F1. The third field of the menu file record correspond-
- ing to the cursor position is used for that help information.
-
-
- EXAMPLES
-
- EXAMPLE 1:
-
- You may already have used this example. It is called by
- INSTALLC.BAT when you ask to see the documentation. First make
- sure that you are in the directory with all of the files from the
- ARC file, then print or type the file CHOICDOC.MNU for reference,
- and type:
-
- CHOICE /M choicdoc.mnu
-
- CHOICE will display 3 choices: Display Choice Document, Print
- Choice Document, and Type Choice Document. If you move the cursor
- to the first choice, the command:
-
- TYPE CHOICE.DOC | MORE
-
- will be executed. In the second field of the first record,
- CHOICDOC.MNU has that command followed by an exclamation mark to
- end the field.
-
- Moving the cursor to the second choice and pressing enter will
- cause CHOICE.DOC to be copied to the printer. The third record
- allows you to type the document without using the more filter.
-
- If you have a browse command file available (such as LIST.COM)
- then try modifying the menu file to allow you to use that instead
- of typing the file and using the more filter. Note that the
- LIST.COM file must be in a directory within your current path
- specification or you must include the path information in the
- second field of the record.
-
- CHOICE Page 11
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- EXAMPLE 2:
-
- In this example, we will run CHOICE in menu mode from a batch
- file. That allows us to call other batch files from the menu.
- Type CHOICMNU and see what happens. By examining the batch files
- and the CHOICMNU.BAT file you should be able to tell what will
- happen. Note that CHOICMNU.BAT uses itself as a menu file. That
- is possible because CHOICE does two things when its menu file has
- a .BAT extension: it searches for the first label line (starting
- with a colon) and only uses records until it sees a record that is
- not a batch file label. Thus you can imbed your menu in the batch
- file that uses it by placing the menu records at or near the top
- of the file. The reason that CHOICE scans for a label record is
- to allow you to have such batch commands as echo off ahead of the
- menu choices.
-
-
- EXAMPLE 3
-
- See the INSTALLC.BAT file for a more complex example of menu use.
- The choices in this menu either call other programs or batch files
- or call INSTALLC again with parameters that cause it to copy
- files, etc. By displaying this file, you can see how things are
- done. Note the pause statements that appear after displaying
- error messages or documentation files. When CHOICE calls a
- program or batch file that types information to the screen, that
- information will disappear when the program or batch file exits.
- It is overlaid by the CHOICE menu and will reappear when you press
- the escape key to exit CHOICE. If you want to see the messages
- before returning to CHOICE, the function must be run by a batch
- file which has a pause statement in it (unless the program
- displaying the message or data does a keyboard wait before
- exiting). CHOICE+ has a way around this - a pause option for the
- menu line that causes CHOICE to wait for a keystroke before
- continuing. CHOICE+ also allows a menu item to specify that it
- should return to DOS after the item is executed instead of
- returning to the menu.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CHOICE Page 12
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- ERROR MESSAGES
-
- CHOICE may issue one or more error messages when errors are found
- in the profile or menu or when errors occur while executing an
- application. When an application is executed, DOS or the
- application can also issue error messages.
-
- CHOICE messages for conditions that are detected while the menu is
- being displayed are shown as a box in reverse video overlaying the
- menu box. Others, including most issued by applications, are
- typed to the display on the next available line and will remain
- after CHOICE ends. The following are the messages issued by
- CHOICE:
-
- No profile. Either the name: "filename"
- is spelled wrong or you must build a new one and try again
-
- The profile or menu file that you specified in the command
- line does not exist. Check that you included the proper path
- information and that you spelled the name correctly, then
- rerun CHOICE.
-
- Error "n" reading in profile or menu "filename"
-
- CHOICE got an error when trying to read the menu or profile
- named in the message. The file exists, but DOS returned an
- error. The number "n" is the DOS error number. CHOICE+ will
- further expand this error message to include a description of
- the error.
-
- Sorry, you must name an application!
-
- This message appears in security mode only. It is displayed
- when the user types an application name that is not found in
- the profile or if he presses either return or escape.
-
- Error: invalid command segment for entry selected in line "n"
-
- The second field of the menu file is invalid. The line in
- error (line "n" of the file) is displayed on the next display
- line. CHOICE terminates on this error. The most likely
- cause is that the field is too long for CHOICE to handle.
- The command segment must be no longer than 64 characters.
-
-
- Error copying file "filename" to "filename"
-
- This error message appears in a box overlaying the bottom of
- the menu. A second line from the list that follows is always
- displayed:
-
- Cannot access output file: "filename"
-
- DOS has denied access to the file in "filename" - why is
- unknown.
-
- CHOICE Page 13
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
-
- File already exists: "filename"
-
- The file named in "filename" already exists and CHOICE
- cannot overlay it.
-
- No more file handles for: "filename"
-
- When choice attempted to open the file named in
- "filename", DOS said that no more file handles were
- available. This message indicated that your config.sys
- file does not specify enough files. Locate the FILES=
- line in your config.sys and increase the number by at
- least 1 or add the line:
- FILES=10
- to your CONFIG.SYS file.
-
- File or path not found: "filename"
-
- The file named in "filename" does not exist and was
- named as an input file in your profile. Check the
- spelling and that the correct path is specified.
-
- Read error on input file "filename"
-
- DOS got a permanent read error while CHOICE was
- attempting to copy the file to either config.sys or
- auto1.bat. If it happens too often, you probably have a
- defective disk. You could try to rename the existing
- file to another name and build a new file with the
- original name. That would make the original file
- unavailable and probably prevent the error.
-
- Output file is read only "filename"
-
- The disk to which you are attempting to copy a file is
- write-protected or you are trying to reuse the name of a
- file that is flagged as read-only in the directory.
- Either remove the protect sticker from the diskette or
- try a new name.
-
- Invalid file handle on output "filename"
-
- This message should never occur. Contact the author if
- it does.
-
- Out of space for output file "filename"
-
- There is not enough space on the output disk or diskette
- for the named file. You must use a different disk or
- create some space by erasing files.
-
-
-
-
-
- CHOICE Page 14
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- Unknown error on output "filename"
-
- This should never occur either. Please contact the
- author if you see it.
-
- Invalid record in menu or profile "filename", field "n"
-
- This message is followed, on the next display line, with the
- record found to be invalid. Check that the fields do not
- exceed the maximum length and that each is terminated by an
- exclamation point and a space (except the last field).
- Correct the error in the menu or profile and rerun CHOICE.
-
- Invalid option: "option"
-
- The option named is invalid. Check the documentation and try
- again after correcting the error.
-
- Too many parameters supplied. Extra is: "parameter"
-
- CHOICE accepts only one parameter in menu mode or two in
- configuration mode. Be sure that you have specified the
- correct mode.
-
-
- Error Messages issued only by CHOICE+:
-
- Error "n" processing SET record from "filename"
-
- Invalid variable ID: "varid" - must be %1 to %255
-
- Out of memory space for variable "varid"
-
- Too many variables.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CHOICE Page 15
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- MISCELLANEOUS
-
- CHOICE was compiled with the Microsoft C compiler Version 5.0.
- CHOICE has been tested on an IBM PC* and IBM PC-XT under PC DOS
- releases 2.1 and 3.2. It should work on other models of PCs and
- reasonably close IBM PC compatible machines under any PC DOS (or
- MS DOS) release from 2.0 up. DOS releases 1.0 and 1.1 will not
- work. If you have any problems, you can contact me via electronic
- mail to 72617,1456 on Compuserve, to BEL471 on The Source or by
- regular mail to:
-
- CHOICEWARE
- 776 14th Street
- Boulder, CO 80302
-
-
- WARRANTY
-
- CHOICE is supplied "as is" without warranty of any kind, either
- expressed or implied. We will not be responsible for damages or
- loss, including special, incidental, or consequential damages,
- resulting from the use of this program. We will endeavor to fix
- problems that prevent this program from working correctly on any
- IBM PC compatible computer as long as you can describe what is
- required. Since this is a public domain program, supported
- without charge, fixes will be made only by uploading the archive
- file to either Compuserve and/or The Source or both at my
- convenience.
-
- CHOICE is copyrighted by Richard S. MacDonald in 1987. All rights
- reserved.
-
- LICENSE
-
- You are hereby licensed to use CHOICE for personal, non-commercial
- purposes only (including for non-profit charitable organizations).
- You may copy the CHOICE11.ARC file and distribute it, without
- additions, deletions, or changes to others without charge,
- including uploading the file to one or more non-commercial
- bulletin board systems. You may place the CHOICE11.ARC file in
- computer club libraries and distribute it to members so long as no
- charge other than a reasonable duplicating cost (no more than $3
- per disk) is charged. CHOICE may not be used for commercial
- purposes without the express written permission of the author or
- his assignees and payment of such fees as are agreed upon. Please
- contact CHOICEWARE for corporate or site licenses.
-
-
-
-
-
-
-
- * IBM, IBM PC, IBM PC-XT, etc. are registered trademarks of
- International Business Machines Corporation.
-
- CHOICE Page 16
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- CHOICE PLUS
-
- As mentioned on the first page, an enhanced version of CHOICE is
- available for a license fee. CHOICE+ adds a number of features
- that make CHOICE more powerful and easier to use. In menu mode,
- CHOICE+ can be told to pause and wait for a key to be pressed
- after executing a program or batch file. In many cases this
- allows a program to be called directly from CHOICE without calling
- an intermediate batch file and speeds execution, reduces memory
- overhead and avoids wasting disk space. CHOICE+ can also be told
- to exit CHOICE+ after a command is executed instead of returning
- to the menu.
-
- CHOICE+ also offers dynamic substitution of fields in commands
- called by CHOICE. Fields in the command field of a menu record
- may be represented by a variable in the form %n (where n is a
- number from 0 to 99). In either case, CHOICE+ searches the
- variables defined in any SET records found in the menu file. If
- the variable is not found CHOICE+ issues an error message and
- ignores the field. If it is found, CHOICE+ looks at the value set
- in the set record. If the first character of the string to which
- the variable is set is an asterisk, CHOICE+ will use the assigned
- value. If not, CHOICE+ asks the user to supply the value for the
- variable, displaying the string assigned in the SET statement as a
- question. The resulting value is then substituted in the command
- string when the program is called.
-
- To save disk space, CHOICE+ allows more than one menu to be
- imbedded within a batch or menu file.
-
- The CHOICE+ package also includes a menu build program. It is a
- simple editor that allows you to enter the fields for each record
- in a menu file. It checks for valid field and record lengths and,
- when you tell it to end, asks for text to be assigned to any
- variables entered in command fields and builds SET records for
- them.
-
-
- OBTAINING CHOICE+:
-
- CHOICE+ is available from CHOICEWARE for a fee of $25.00 U.S. The
- package consists of one disk containing the program, documentation
- and sample files. If you prefer printed documentation, include an
- additional $10. The documentation will be photo-copied on either
- 5 1/2" by 8 1/2" paper punched to fit a standard PC documentation
- binder or on 8 1/2" by 11" paper punched to fit a standard 3-hole
- binder. For your convenience, and order form is on the last page
- of this document. The same form may be used to get on our mailing
- list for announcements of new programs and updates.
-
-
-
-
-
-
-
- CHOICE Page 17
-
-
- CHOICE V1.1 Copyright 1987 R. S. MacDonald
-
-
- CHOICE+ ORDER FORM
-
-
- TO: CHOICEWARE
- 776 14th Street
- Boulder, CO 80302
-
-
- ORDERED BY: SHIP TO:
-
- Name: ____________________________ Name:_______________________________
-
- Company: _________________________ Company:____________________________
-
- Street: __________________________ Street: ____________________________
-
- City:_____________________________ City:_______________________________
-
- State: _____ ZIP: ___________ State: _____ ZIP: ___________
-
-
-
- PRODUCT QUANTITY PRICE TOTAL
-
- CHOICE+ . . . . . . . . . . . . . . . . . . ________ $25.00 _________
-
- CHOICE+ Hard Copy Documentation . . . . . . ________ $10.00 _________
-
- RUSH Shipping (Second day air). . . . . . . . . . . . $10.00 _________
-
- TOTAL AMOUNT INCLUDED WITH ORDER. . . . . . . . . . . . . . . .$ ________
-
-
- MEDIA: 5 1/4" DSDD ______ 5 1/4" SSDD ______ 3 1/2" 720K _____
-
- I prefer hard copy documentation in the following format:
-
- 5 1/2" X 8 1/2" ____ 8 1/2" X 11" ____
-
- I wish to be on your mailing list for new product
-
- announcements: YES _____ NO _____
-
- Comments (Please continue on reverse): _____________________________________
-
- ____________________________________________________________________________
-
- ____________________________________________________________________________
-
- ____________________________________________________________________________
-
- Thank you for your order. We appreciate your business.
-
-
-
-
- CHOICE Page 18
-